﻿using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Text;

namespace MQ.Core.Common
{
    public static class DbLoggerExtentions
    {
        public static ILoggerFactory AddDb(this ILoggerFactory factory,IConfiguration configuration)
        {
            return AddDb(factory, new DbLoggerOption(configuration));
        }

        public static ILoggerFactory AddDb(this ILoggerFactory factory, DbLoggerOption option)
        {
            factory.AddProvider(new DbLoggerProvider(option));
            return factory;
        }
    }
}
